package xj.utils;

import javax.servlet.http.HttpServletRequest;

import com.jfinal.core.JFinal;
import com.jfinal.kit.PathKit;

/**
 * 
 * @author zhangxudong
 *
 */
public class PathUtil {

	/**
	 * @return /项目名
	 */
	public static String getContextPath() {
		return JFinal.me().getContextPath();
	}
	
	/**
	 * @return D:\_eclipsework\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\项目名
	 */
	public static String getWebRootPath() {
		return PathKit.getWebRootPath();
	}
	
	/**
	 * @param request
	 * @return E:\_eclipsework\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\项目名\
	 */
	public static String getRealPath(HttpServletRequest request) {
		return request.getSession().getServletContext().getRealPath("/");
	}
}
